#ifndef APPWINDOW_H
#define APPWINDOW_H

#include <QMainWindow>
#include "onetclient.h"

namespace Ui {
    class AppWindow;
}

class QListWidgetItem;

class AppWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit AppWindow(QWidget *parent = 0);
    ~AppWindow();

protected:
    virtual void closeEvent(QCloseEvent *e);

private:
    Ui::AppWindow *ui;
    OnetClient* client;

    QString iLastRoom;

    bool getLoginAndPassword();

    QString iLogin, iPassword;

private slots:
    void onMessage(QString aMsg);
    void onSend();
    void onNickAdded(QString aChannel, QString aNick, QString aPrefix, QString aSuffix);
    void onItemClick(QListWidgetItem*);
    void credentialsProvided(QString aNick, QString aPassowrd);
    void credentialsCancelled();
    void storeSavedCredentials();

signals:
    void cancelWait();
};

#endif // APPWINDOW_H
